home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Controls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  5.7 KB  |  213 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Friday, September 13, 1991 at 12:21 PM
  5.  Controls.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1985-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __CONTROLS__
  16. #define __CONTROLS__
  17.  
  18. #ifndef __QUICKDRAW__
  19. #include <Quickdraw.h>
  20. #endif
  21.  
  22.  
  23. enum {
  24.  
  25.  pushButProc = 0,
  26.  checkBoxProc = 1,
  27.  radioButProc = 2,
  28.  useWFont = 8,
  29.  scrollBarProc = 16,
  30.  inButton = 10,
  31.  inCheckBox = 11,
  32.  inUpButton = 20,
  33.  inDownButton = 21,
  34.  inPageUp = 22,
  35.  inPageDown = 23,
  36.  inThumb = 129,
  37.  
  38.  popupMenuProc = 1008,        /* 63 * 16 */
  39.  inLabel = 1,
  40.  inMenu = 2,
  41.  inTriangle = 4
  42. };
  43.  
  44. enum { popupFixedWidth  = 1 << 0, popupReserved   = 1 << 1, popupUseAddResMenu = 1 << 2,
  45.   popupUseWFont  = 1 << 3};
  46.  
  47. enum { popupTitleBold  = 1 << 8, popupTitleItalic = 1 << 9, popupTitleUnderline = 1 << 10,
  48.   popupTitleOutline = 1 << 11, popupTitleShadow = 1 << 12, popupTitleCondense = 1 << 13,
  49.   popupTitleExtend = 1 << 14, popupTitleNoStyle = 1 << 15};
  50.  
  51.  
  52. enum {
  53.  
  54.  popupTitleLeftJust = 0x00000000,
  55.  popupTitleCenterJust = 0x00000001,
  56.  popupTitleRightJust = 0x000000FF,
  57.  
  58. /*
  59. axis constraints for DragGrayRgn call*/
  60.  noConstraint = 0,
  61.  hAxisOnly = 1,
  62.  vAxisOnly = 2,
  63.  
  64. /*
  65. control messages*/
  66.  drawCntl = 0,
  67.  testCntl = 1,
  68.  calcCRgns = 2,
  69.  initCntl = 3,
  70.  dispCntl = 4,
  71.  posCntl = 5,
  72.  thumbCntl = 6,
  73.  dragCntl = 7,
  74.  autoTrack = 8,
  75.  calcCntlRgn = 10,
  76.  calcThumbRgn = 11,
  77.  
  78.  cFrameColor = 0,
  79.  cBodyColor = 1,
  80.  cTextColor = 2
  81. };
  82. enum {
  83.  cThumbColor = 3
  84. };
  85.  
  86. struct ControlRecord {
  87.  struct ControlRecord **nextControl;
  88.  WindowPtr contrlOwner;
  89.  Rect contrlRect;
  90.  unsigned char contrlVis;
  91.  unsigned char contrlHilite;
  92.  short contrlValue;
  93.  short contrlMin;
  94.  short contrlMax;
  95.  Handle contrlDefProc;
  96.  Handle contrlData;
  97.  ProcPtr contrlAction;
  98.  long contrlRfCon;
  99.  Str255 contrlTitle;
  100. };
  101.  
  102. typedef struct ControlRecord ControlRecord;
  103. typedef ControlRecord *ControlPtr, **ControlHandle;
  104.  
  105.  
  106. struct CtlCTab {
  107.  long ccSeed;                /*reserved*/
  108.  short ccRider;                /*see what you have done - reserved*/
  109.  short ctSize;                /*usually 3 for controls*/
  110.  ColorSpec ctTable[4];
  111. };
  112.  
  113. typedef struct CtlCTab CtlCTab;
  114. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  115.  
  116. struct AuxCtlRec {
  117.  Handle acNext;                /*handle to next AuxCtlRec*/
  118.  ControlHandle acOwner;        /*handle for aux record's control*/
  119.  CCTabHandle acCTable;        /*color table for this control*/
  120.  short acFlags;                /*misc flag byte*/
  121.  long acReserved;            /*reserved for use by Apple*/
  122.  long acRefCon;                /*for use by application*/
  123. };
  124.  
  125. typedef struct AuxCtlRec AuxCtlRec;
  126. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  127.  
  128.  
  129. #ifdef __cplusplus
  130. extern "C" {
  131. #endif
  132. pascal ControlHandle NewControl(WindowPtr theWindow,const Rect *boundsRect,
  133.  ConstStr255Param title,Boolean visible,short value,short min,short max,
  134.  short procID,long refCon)
  135.  = 0xA954; 
  136. pascal void SetCTitle(ControlHandle theControl,ConstStr255Param title)
  137.  = 0xA95F; 
  138. pascal void GetCTitle(ControlHandle theControl,Str255 title)
  139.  = 0xA95E; 
  140. pascal ControlHandle GetNewControl(short controlID,WindowPtr owner)
  141.  = 0xA9BE; 
  142. pascal void DisposeControl(ControlHandle theControl)
  143.  = 0xA955; 
  144. pascal void KillControls(WindowPtr theWindow)
  145.  = 0xA956; 
  146. pascal void HideControl(ControlHandle theControl)
  147.  = 0xA958; 
  148. pascal void ShowControl(ControlHandle theControl)
  149.  = 0xA957; 
  150. pascal void DrawControls(WindowPtr theWindow)
  151.  = 0xA969; 
  152. pascal void Draw1Control(ControlHandle theControl)
  153.  = 0xA96D; 
  154. pascal void HiliteControl(ControlHandle theControl,short hiliteState)
  155.  = 0xA95D; 
  156. pascal void UpdtControl(WindowPtr theWindow,RgnHandle updateRgn)
  157.  = 0xA953; 
  158. pascal void UpdateControls(WindowPtr theWindow,RgnHandle updateRgn)
  159.  = 0xA953; 
  160. pascal void MoveControl(ControlHandle theControl,short h,short v)
  161.  = 0xA959; 
  162. pascal void SizeControl(ControlHandle theControl,short w,short h)
  163.  = 0xA95C; 
  164. pascal void SetCtlValue(ControlHandle theControl,short theValue)
  165.  = 0xA963; 
  166. pascal short GetCtlValue(ControlHandle theControl)
  167.  = 0xA960; 
  168. pascal void SetCtlMin(ControlHandle theControl,short minValue)
  169.  = 0xA964; 
  170. pascal short GetCtlMin(ControlHandle theControl)
  171.  = 0xA961; 
  172. pascal void SetCtlMax(ControlHandle theControl,short maxValue)
  173.  = 0xA965; 
  174. pascal short GetCtlMax(ControlHandle theControl)
  175.  = 0xA962; 
  176. pascal void SetCRefCon(ControlHandle theControl,long data)
  177.  = 0xA95B; 
  178. pascal long GetCRefCon(ControlHandle theControl)
  179.  = 0xA95A; 
  180. pascal void SetCtlAction(ControlHandle theControl,ProcPtr actionProc)
  181.  = 0xA96B; 
  182. pascal ProcPtr GetCtlAction(ControlHandle theControl)
  183.  = 0xA96A; 
  184. pascal void DragControl(ControlHandle theControl,Point startPt,const Rect *limitRect,
  185.  const Rect *slopRect,short axis)
  186.  = 0xA967; 
  187. pascal short TestControl(ControlHandle theControl,Point thePt)
  188.  = 0xA966; 
  189. pascal short TrackControl(ControlHandle theControl,Point thePoint,ProcPtr actionProc)
  190.  = 0xA968; 
  191. pascal short FindControl(Point thePoint,WindowPtr theWindow,ControlHandle *theControl)
  192.  = 0xA96C; 
  193. pascal void SetCtlColor(ControlHandle theControl,CCTabHandle newColorTable)
  194.  = 0xAA43; 
  195. pascal Boolean GetAuxCtl(ControlHandle theControl,AuxCtlHandle *acHndl)
  196.  = 0xAA44; 
  197. pascal short GetCVariant(ControlHandle theControl)
  198.  = 0xA809; 
  199. void dragcontrol(ControlHandle theControl,Point *startPt,const Rect *limitRect,
  200.  const Rect *slopRect,short axis); 
  201. ControlHandle newcontrol(WindowPtr theWindow,const Rect *boundsRect,char *title,
  202.  Boolean visible,short value,short min,short max,short procID,long refCon); 
  203. short findcontrol(Point *thePoint,WindowPtr theWindow,ControlHandle *theControl); 
  204. void getctitle(ControlHandle theControl,char *title); 
  205. void setctitle(ControlHandle theControl,char *title); 
  206. short trackcontrol(ControlHandle theControl,Point *thePoint,ProcPtr actionProc); 
  207. short testcontrol(ControlHandle theControl,Point *thePt); 
  208. #ifdef __cplusplus
  209. }
  210. #endif
  211.  
  212. #endif
  213.